package org.zhadoop.stream.cql.semanticanalyzer.parser.visitor;

import org.antlr.v4.runtime.misc.NotNull;
import org.zhadoop.stream.cql.semanticanalyzer.parser.CQLParser.ColumnNameOrderContext;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.OrderbyClauseContext;

public class OrderbyClauseVisitor extends AbsCQLParserBaseVisitor<OrderbyClauseContext>{

	private OrderbyClauseContext context = null;
	
	public OrderbyClauseVisitor() {
		context = new OrderbyClauseContext();
	}
	
	@Override
	protected OrderbyClauseContext defaultResult() {
		return context;
	}
	
	@Override
	public OrderbyClauseContext visitColumnNameOrder(@NotNull ColumnNameOrderContext ctx) {
		ColumnNameOrderVisitor visitor = new ColumnNameOrderVisitor();
        context.getOrderColumns().add(visitor.visit(ctx));
        return context;
	}

}
